function ListNode(val) {
    this.val = val;
    this.next = null;
};
/**
 * @param {ListNode} l1
 * @param {ListNode} l2
 * @return {ListNode}
 */
var mergeTwoLists = function(l1, l2) {
    // 设置一个呀节点
    let newHead = new ListNode(-1)
    let cur = newHead // 移动新链表的指针
    // 有一个等于null 就终止条件
    while (l1 != null && l2 != null) {
        if (l1.val < l2.val) {
            cur.next = l1
            l1 = l1.next
        }else {
            cur.next = l2
            l2 = l2.next
        }
        cur = cur.next

    }
    if(l1 == null) {
        cur.next = l2
    }else {
        cur.next = l1
    }
    return newHead.next
};
let l1 = new ListNode(null)
let l2 =new  ListNode(0)
console.log(mergeTwoLists(l1,l2))